<template>
  <el-container style="height: 100%; border: 1px solid #eee">
    <el-aside :width="aside_witdh" class="asideSSS">
      <Aside :isCollapse="isCollapse"></Aside>
    </el-aside>
    <el-container class="containerSSS">
      <el-header class="head">
        <Header :icon="icon" @doCollapse="doCollapse"></Header>
      </el-header>
      <el-main style="height: 100%;">
        <router-view/>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import Aside from "./Aside";
import Header from "./Header";

export default {
  name: "Index",
  components: {Aside, Header},
  data() {
    return {
      isCollapse: false,
      aside_witdh: '220px',
      icon: 'el-icon-s-fold'
    }
  },
  methods: {
    doCollapse() {
      this.isCollapse = !this.isCollapse
      if (!this.isCollapse) {// 展开
        this.aside_witdh = '220px'
        this.icon = 'el-icon-s-fold'
      } else {//关起、关闭、收起
        this.aside_witdh = '64px'
        this.icon = 'el-icon-s-unfold'
      }
    }
  }
}
</script>

<style>
.head {
  text-align: right;
  font-size: 12px;
  height: 100%;
  background-color: #22a2c3;

}

.asideSSS {
  height: 100vh;
  margin-left: -1px;
  transition: 0.5s ease;
}

.containerSSS {
  height: 100vh;
  transition: 0.5s ease;
}

.el-header {
  line-height: 60px;
}

.el-main {
  padding: 0px;
}

body {
  overflow-y: hidden;
}
</style>
